package flume;

import java.nio.charset.Charset;

import org.apache.flume.Event;
import org.apache.flume.EventDeliveryException;
import org.apache.flume.api.RpcClient;
import org.apache.flume.api.RpcClientFactory;
import org.apache.flume.event.EventBuilder;

public class App {
	
	private static RpcClient client;

	public static void main(String[] args) throws EventDeliveryException {

		client = RpcClientFactory.getDefaultInstance("192.168.142.129", 4141);
		for(int i = 100; i < 101; i++){
			Event event = EventBuilder.withBody("data-" + i, Charset.forName("utf-8"));
			client.append(event);
		}
		client.close();
	}

}
